package com.lanou3g.k12.service.impl;

import com.lanou3g.k12.entity.EventCategory;
import com.lanou3g.k12.mapper.EventCategoryMapper;
import com.lanou3g.k12.service.EventCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class EventCategoryServiceImpl implements EventCategoryService {
    @Autowired
    private EventCategoryMapper eventCategoryMapper;
    @Override
    public void addEventCategory(EventCategory eventCategory) {
        eventCategory.setCreateTime(new Date());
        eventCategory.setUpdateTime(new Date());
        System.out.println(eventCategory.getCreateTime() + "]]]]]]");
        eventCategoryMapper.addEventCategory(eventCategory);
    }

    @Override
    public void updateEventCategoryStatus(Long cid) {
        eventCategoryMapper.updateEventCategoryStatus(cid);
    }

    @Override
    public void deleteCategoryById(Long id) {
        eventCategoryMapper.deleteCategoryById(id);
    }
}
